package com.khoinguyen.feedtweet.test;

import java.util.List;

import twitter4j.Paging;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.UserMentionEntity;

public class GetTweets {
	public static void main(String[] args) throws TwitterException {
		Twitter twitter = new TwitterFactory().getInstance();
		Paging paging = new Paging(1, 5);
		
		List<Status> statuses = twitter.getUserTimeline("stevanLM", paging);
		for (Status s : statuses) {
			System.out.println(s.getText());
//			System.out.println(s.getText());
			System.out.println(s.isRetweet());
			UserMentionEntity[] userMentions = s.getUserMentionEntities();
			if (userMentions.length > 0) {
				for (UserMentionEntity u : userMentions) {
					System.out.println(u.getName());
				}
			}
			System.out.println("================\n\n");
		}
		
	}
}
